<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>
<%@ include file="/common/boxy.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>编辑流程</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="编辑,流程">
	<meta http-equiv="description" content="This is my page">
	
	<script type="text/javascript" src="${CONTEXT_PATH}/js/login/business/common/xmlUtil.js"></script>
	<script type="text/javascript" src="${CONTEXT_PATH}/js/login/business/sysManagement/flow/editFlow.js"></script>
	
	<style type="text/css">
	center
	{
		height:100%;
	}
	
	form
	{
		height:100%;
	}
	</style>
	
  </head>
  
  <body>
    <center>
    	<s:form name="frm" id="frm" method="post" action="" namespace="">
    		<jsp:include page="/jsp/outward/business/common/menuLink.jsp">
    			<jsp:param name="menuLink" value="[{'name':'系统管理'},{'name':'流程管理'},{'name':'编辑流程'}]"/>
    			<jsp:param name="width" value="60%"/>
    		</jsp:include>
    		<s:hidden id="flowType" name="flowType"></s:hidden>
    		<s:hidden id="flowId" name="wf.id"></s:hidden>
    		<s:hidden id="content" name="wf.contentStr"></s:hidden>
    		<s:hidden id="fmId" name="wf.flowModule.id"></s:hidden>
    		<s:hidden id="maxId" name="wf.maxId"></s:hidden>
    		
    		<a id="startLink" title="修改" href="#startDiv" class="boxy" style="display:none"></a>
    		<s:div id="startDiv"  cssStyle="width:350px; display:none;">
    			<s:hidden id="startId"></s:hidden>
    			<table width="100%" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
    				<tr bgcolor="#FFFFFF">
    					<td width="25%" align="right" class="label">
    						状态：
    					</td>
    					<td width="75%" align="left">
    						<s:select list="bdList" id="startStatus" name="startStatus" listKey="id" listValue="dataValue" headerKey="" headerValue="--请选择--" cssStyle="width:100px"></s:select>
    					</td>
    				</tr>
    				<tr bgcolor="#FFFFFF">
    					<td align="right" class="label">
    						名称：
    					</td>
    					<td align="left">
    						<input type="text" id="startName" name="startName" style="width:220px" maxlength="20" />
    					</td>
    				</tr>
    				<tr bgcolor="#FFFFFF">
    					<td align="right" class="label">
    						参与者：
    					</td>
    					<td align="left">
    						<div id="startActorsDiv" style="display:inline">未绑定</div>
    						&nbsp;
    						<a href="javascript:toSelectActors('start')">选择</a>
    						<input type="hidden" id="startActors" name="startActors" />
    					</td>
    				</tr>
    			</table>
    			
    			<table width="100%" cellspacing="0">
	    			<tr>
	    				<td align="center" valign="bottom" height="30">
	    					<input type="button" value="保存" class="btn" onclick="saveStart()" />
	    				</td>
	    			</tr>
	    		</table>
    		</s:div>
    		
    		<a id="taskLink" title="修改" href="#taskDiv" class="boxy" style="display:none"></a>
    		<s:div id="taskDiv"  cssStyle="width:650px; display:none;">
    			<s:hidden id="taskId"></s:hidden>
    			<table width="100%" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
    				<tr bgcolor="#FFFFFF">
    					<td width="20%" align="right" class="label">
    						状态：
    					</td>
    					<td width="80%" align="left">
    						<s:select list="bdList" id="taskStatus" name="taskStatus" listKey="id" listValue="dataValue" headerKey="" headerValue="--请选择--" cssStyle="width:100px"></s:select>
    					</td>
    				</tr>
    				<tr bgcolor="#FFFFFF">
    					<td align="right" class="label">
    						名称：
    					</td>
    					<td align="left">
    						<input type="text" id="taskName" name="taskName" style="width:320px" maxlength="20" />
    					</td>
    				</tr>
    				<tr bgcolor="#FFFFFF">
    					<td align="right" class="label">
    						参与者模式：
    					</td>
    					<td align="left">
    						<s:select id="taskActorsMode" name="taskActorsMode" list='#{"select":"选择", "code":"代码"}' cssStyle="width:100px" onchange="taskActorsModeChange()"></s:select>
    					</td>
    				</tr>
    				<tbody id="taskActorsModeCodeTb">
    				<tr bgcolor="#FFFFFF">
    					<td align="right" class="label">
    						模式代码：
    					</td>
    					<td align="left">
    						<s:textarea id="taskActorsModeCode" name="taskActorsModeCode" cssStyle="width:95%; height:150px"></s:textarea>
    					</td>
    				</tr>
    				</tbody>
    				<tbody id="taskActorsTb">
    				<tr bgcolor="#FFFFFF">
    					<td align="right" class="label">
    						参与者：
    					</td>
    					<td align="left">
    						<div id="taskActorsDiv" style="display:inline">未绑定</div>
    						&nbsp;
    						<a href="javascript:toSelectActors('task')">选择</a>
    						<input type="hidden" id="taskActors" name="taskActors" />
    					</td>
    				</tr>
    				</tbody>
    				<tr bgcolor="#FFFFFF">
    					<td align="right" class="label">
    						发送到个人：
    					</td>
    					<td align="left">
    						<s:select id="taskAssignToUser" name="taskAssignToUser" list='#{"false":"否", "true":"是"}' cssStyle="width:100px"></s:select>
    					</td>
    				</tr>
    				<tr bgcolor="#FFFFFF">
    					<td align="right" class="label">
    						审批条件：
    					</td>
    					<td align="left">
    						<s:select id="taskConditionType" name="taskConditionType" list='#{"or":"或者", "and":"并且", "percentage":"百分比"}' cssStyle="width:100px" onchange="taskConditionTypeChange()"></s:select>
    						<s:select id="taskPercentage" name="taskPercentage" list='#{"0.2":"20%", "0.5":"50%", "0.8":"80%", "0.9":"90%", "0.95":"95%"}' cssStyle="width:80px"></s:select>
    					</td>
    				</tr>
    				<tr bgcolor="#FFFFFF">
    					<td align="right" class="label">
    						允许退回：
    					</td>
    					<td align="left">
    						<s:select id="taskPermitReturn" name="taskPermitReturn" list='#{"true":"是", "false":"否"}' cssStyle="width:100px"></s:select>
    					</td>
    				</tr>
    				<tr bgcolor="#FFFFFF">
    					<td align="right" class="label">
    						字段开放代码：
    					</td>
    					<td align="left">
    						<s:textarea id="taskModifyCode" name="taskModifyCode" cssStyle="width:95%; height:150px"></s:textarea>
    					</td>
    				</tr>
    				
    			</table>
    			
    			<table width="100%" cellspacing="0">
	    			<tr>
	    				<td align="center" valign="bottom" height="30">
	    					<input type="button" value="保存" class="btn" onclick="saveTask()" />
	    				</td>
	    			</tr>
	    		</table>
    		</s:div>
    		
    		<a id="endLink" title="修改" href="#endDiv" class="boxy" style="display:none"></a>
    		<s:div id="endDiv"  cssStyle="width:350px; display:none;">
    			<s:hidden id="endId"></s:hidden>
    			<table width="100%" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
    				<tr bgcolor="#FFFFFF">
    					<td width="25%" align="right" class="label">
    						状态：
    					</td>
    					<td width="75%" align="left">
    						<s:select list="bdList" id="endStatus" name="endStatus" listKey="id" listValue="dataValue" headerKey="" headerValue="--请选择--" cssStyle="width:100px"></s:select>
    					</td>
    				</tr>
    				<tr bgcolor="#FFFFFF">
    					<td align="right" class="label">
    						名称：
    					</td>
    					<td align="left">
    						<input type="text" id="endName" name="endName" style="width:220px" maxlength="20" />
    					</td>
    				</tr>
    			</table>
    			
    			<table width="100%" cellspacing="0">
	    			<tr>
	    				<td align="center" valign="bottom" height="30">
	    					<input type="button" value="保存" class="btn" onclick="saveEnd()" />
	    				</td>
	    			</tr>
	    		</table>
    		</s:div>
    		
    		<a id="textLink" title="修改" href="#textDiv" class="boxy" style="display:none"></a>
    		<s:div id="textDiv"  cssStyle="width:400px; display:none;">
    			<s:hidden id="textId"></s:hidden>
    			<table width="100%" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
    				<tr bgcolor="#FFFFFF">
    					<td align="right" width="25%" class="label">
    						描述：
    					</td>
    					<td align="left" width="75%">
    						<input type="text" id="textName" name="textName" style="width:260px" maxlength="30px" />
    					</td>
    				</tr>
    			</table>
    			
    			<table width="100%" cellspacing="0">
	    			<tr>
	    				<td align="center" valign="bottom" height="30">
	    					<input type="button" value="保存" class="btn" onclick="saveText()" />
	    				</td>
	    			</tr>
	    		</table>
    		</s:div>
    		
    		<a id="arrowLink" title="修改" href="#arrowDiv" class="boxy" style="display:none"></a>
    		<s:div id="arrowDiv"  cssStyle="width:650px; display:none;">
    			<s:hidden id="arrowId"></s:hidden>
    			<table width="100%" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
    				<tr bgcolor="#FFFFFF">
    					<td align="right" width="20%" class="label">
    						排序：
    					</td>
    					<td align="left" width="80%">
    						<s:textfield id="arrowSort" name="arrowSort" cssStyle="width:60px;"></s:textfield>
    					</td>
    				</tr>
    				<tr bgcolor="#FFFFFF">
    					<td align="right" class="label">
    						条件：
    					</td>
    					<td align="left">
    						<s:textarea id="arrowConditionCode" name="arrowConditionCode" cssStyle="width:95%; height:150px"></s:textarea>
    					</td>
    				</tr>
    				<tr bgcolor="#FFFFFF">
    					<td align="right" class="label">
    						动作：
    					</td>
    					<td align="left">
    						<s:textarea id="arrowActionCode" name="arrowActionCode" cssStyle="width:95%; height:150px"></s:textarea>
    					</td>
    				</tr>
    			</table>
    			
    			<table width="100%" cellspacing="0">
	    			<tr>
	    				<td align="center" valign="bottom" height="30">
	    					<input type="button" value="保存" class="btn" onclick="saveArrow()" />
	    				</td>
	    			</tr>
	    		</table>
    		</s:div>
    		
    		<table width="100%">
    			<tr>
    				<td width="80px" align="right">流程名称：</td>
    				<td align="left">
			    		<s:textfield name="wf.flowName" id="flowName" cssStyle="width:300px" maxlength="20"></s:textfield>
    				</td>
    			</tr>
    		</table>
			<embed id="emb1" src="${CONTEXT_PATH}/common/svg/flow.svg" width="97%" height="89%" type="image/svg+xml" wmode="transparent" style="overflow:scroll" />
    	
    	</s:form>
    </center>
    
  </body>
</html>
